/*
 * $Id: DirectionsDistance.java 42 2013-04-17 15:33:59Z gabakyan $
 * $Author: gabakyan $
 * $Revision: 42 $
 * $Date: 2013-04-17 15:33:59 +0000 (Wed, 17 Apr 2013) $
 *
 * Copyright (c) 2013 Supply Chain Intelligence (SCI), Inc.
 * http://www.scintelligence.com/, Email: info@scintelligence.com
 * All rights reserved.
 *
 * This file is part of Logistics Map.
 *
 * Logistics Map is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 3 of the License.
 *
 * Logistics Map is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Logistics Map.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.sci.logisticsmap.support.model.geocoding;

import java.io.Serializable;

/**
 * The interface {@code DirectionsDistance} represents the geocoding directions distance.
 *
 * @author gabakyan@gmail.com (Last modified by $Author: gabakyan $)
 * @version $Revision: 42 $
 */
public class DirectionsDistance implements Serializable {
    /**
     * The serial version id.
     */
    private static final long serialVersionUID = 1L;

    /**
     * The value.
     */
    private int value;
    /**
     * The text.
     */
    private String text;

    /**
     * Gets the value.
     *
     * @return The value.
     */
    public int getValue() {
        return value;
    }

    /**
     * Sets the value.
     *
     * @param value The value.
     */
    public void setValue(int value) {
        this.value = value;
    }

    /**
     * Gets the text.
     *
     * @return The text.
     */
    public String getText() {
        return text;
    }

    /**
     * Sets the text.
     *
     * @param text The text.
     */
    public void setText(String text) {
        this.text = text;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        DirectionsDistance that = (DirectionsDistance) o;

        if (value != that.value) return false;
        if (text != null ? !text.equals(that.text) : that.text != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = value;
        result = 31 * result + (text != null ? text.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "DirectionsDistance{" +
                "value=" + value +
                ", text='" + text + '\'' +
                '}';
    }
}
